curl -k -H "Content-Type:application/json" -H "X-Auth-Token:$token" -X POST "https://{servicestage_endpoint}/v3/{project_id}/cas/applications/{application_id}/components" -d ' 
{
    "name": "test-component",
    "description": "",
    "labels": [],
    "version": "2023.0712.09204",
    "environment_id": "21a43958-f64f-4077-8ae3-3a03bf0111c7",
    "application_id": "2c458700-c8e0-4651-a73b-5219b70a6572",
    "enterprise_project_id": "0",
    "runtime_stack": {
        "name": "Docker",
        "version": "",
        "type": "Docker",
        "deploy_mode": "container"
    },
    "source": {
        "kind": "image",
        "storage": "swr",
        "url": "swr.cn-north-7.myhuaweicloud.com/servicestage-demo/test_02:v1",
        "version": "v1"
    },
    "tomcat_opts": {
        "server_xml": ""
    },
    "refer_resources": [
        {
            "id": "1d3091a2-1ecf-11ee-ae69-0255ac1001ba",
            "type": "cce",
            "parameters": {
                "namespace": "default",
                "type": "VirtualMachine"
            }
        }
    ],
    "replica": 2,
    "config_mode": "ui",
    "limit_cpu": 0.25,
    "limit_memory": 0.5,
    "request_cpu": 0.25,
    "request_memory": 0.5,
    "external_accesses": [],
    "storages": [],
    "logs": [],
    "affinity": {
        "az": [],
        "node": [],
        "component": []
    },
    "anti_affinity": {
        "az": [],
        "node": [],
        "component": []
    },
    "update_strategy": {
        "type": "RollingUpdate",
        "max_surge": 0,
        "max_unavailable": 1
    },
    "command": {
        "args": [],
        "command": []
    },
    "custom_metric": {}
}'

